package com.pengcheng.taskapplication.net;
import com.pengcheng.taskapplication.model.AccountModel;
import com.pengcheng.taskapplication.model.AccountTranModel;
import com.pengcheng.taskapplication.model.AccountVerify;
import com.pengcheng.taskapplication.model.BaseEntity;
import com.pengcheng.taskapplication.model.BaseListEntity;
import com.pengcheng.taskapplication.model.BindCardModel;
import com.pengcheng.taskapplication.model.CarModel;
import com.pengcheng.taskapplication.model.CheckModel;
import com.pengcheng.taskapplication.model.CodeModel;
import com.pengcheng.taskapplication.model.CommitOrderModel;
import com.pengcheng.taskapplication.model.IcbcValidateModel;
import com.pengcheng.taskapplication.model.IcbcverifySms;
import com.pengcheng.taskapplication.model.IdcardAllOcrModel;
import com.pengcheng.taskapplication.model.IdcardBackOcrModel;
import com.pengcheng.taskapplication.model.IdcardFrontOcrModel;
import com.pengcheng.taskapplication.model.OpenAccountResult;
import com.pengcheng.taskapplication.model.PageVo;
import com.pengcheng.taskapplication.model.ParkOrderModel;
import com.pengcheng.taskapplication.model.PlateNoModel;
import com.pengcheng.taskapplication.model.RealNameAuthModel;
import com.pengcheng.taskapplication.model.SubscribeOrderListModel;
import com.pengcheng.taskapplication.model.SubscribeOrderModel;
import com.pengcheng.taskapplication.model.TaskVo;
import com.pengcheng.taskapplication.model.UrlItemModel;
import com.pengcheng.taskapplication.model.UserDetailVo;
import com.pengcheng.taskapplication.model.UserRegisterVo;
import com.pengcheng.taskapplication.model.UserTokenModel;
import com.pengcheng.taskapplication.model.UserUpdatePasswordVo;
import com.pengcheng.taskapplication.model.UserVo;
import com.pengcheng.taskapplication.model.VehicleId;
import com.pengcheng.taskapplication.model.WXEntity;

import java.util.ArrayList;
import java.util.List;

import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;
import retrofit2.http.Streaming;
import rx.Observable;


/**
 * Created by kekex on 2019/2/28.
 * new api
 */
public interface ApiStore {


    /**
     * 创建订单
     */
    @POST("parking/createorder")
    Observable<BaseEntity> createOrder(
            @Body CommitOrderModel commitOrderModel
    );

    /**
     * 订单详情接口
     */
    @FormUrlEncoded
    @POST("parking/getorderone")
    Observable<BaseEntity<ParkOrderModel>> getOrderDetail(
            @Field("token") String token,
            @Field("uid") String uid,
            @Field("tradno") String tradno
    );






    /**
     * 拉取预支付信息接口
     */
    @FormUrlEncoded
    @POST("parking/wxpay")
    Observable<BaseEntity<WXEntity>> wxpay(
            @Field("token") String token,
            @Field("uid") String uid,
            @Field("tradno") String tradno
    );



    /**
     * 登录接口
     */
    @POST("security/login")
    Observable<BaseEntity<UserTokenModel>> login(
            @Body UserVo userVo
    );

    /**
     * 实名认证
     */
    @POST("Security/realNameAuthV2")
    Observable<BaseEntity<RealNameAuthModel>> realNameAuthV2(
            @Body IdcardAllOcrModel idcardAllOcrModel
    );
    /**
     * 用户认证状态检查
     请求地址：https://{HOST}/icbc/checkCert
     请求方式：GET
     传参方式：QueryString
     */
    @GET("icbc/checkCert")
    Observable<BaseEntity<CheckModel>> checkCert(

    );



    /**
     * 订单详情接口
     */
    @FormUrlEncoded
    @POST("http://103.131.169.210:8888/user/checktoken")
    Observable<BaseEntity> checkToken(
            @Field("token") String token,
            @Field("uid") String uid
    );







    /**
     * 取消申请接口
     */
    @FormUrlEncoded
    @POST("vehicle/cancelSubscribeOrder")
    Observable<BaseEntity> cancelApply(
       @Field("id") long id
    );

    /**
     * 旧认证接口
     */
    @FormUrlEncoded
    @POST("icbc/idcardFrontReOcr")
    Observable<BaseEntity<IdcardFrontOcrModel>> idcardFrontReOcr(
            @Field("certId") long certId
    );


    /**
     * 旧认证接口
     */
    @FormUrlEncoded
    @POST("icbc/idcardBackReOcr")
    Observable<BaseEntity<IdcardBackOcrModel>> idcardBackReOcr(
            @Field("certId") long certId
    );





    /**
     * 工行验证码
     */
    @POST("icbc/sendSms")
    Observable<BaseEntity> sendSms(
            @Body IcbcValidateModel icbcValidateModel
    );


    /**
     * 获取二维码
     */
    @GET("util/getQrCode")
    Observable<ResponseBody> getQrCode(
            @Query("code") String code,
            @Query("size") int size
    );





    /**
     * 工行内部短信验证
     */
    @POST("icbc/verifySms")
    Observable<BaseEntity> verifySms(
            @Body IcbcverifySms icbcverifySms
    );

    /**
     * 获取开户前信息
     */
    @GET("icbc/openAccountInit")
    Observable<BaseEntity<AccountModel>> openAccountInit(

    );



    @GET("vehicle/getSubscribeOrder")
    Observable<BaseEntity<SubscribeOrderModel>> getSubscribeOrder(
            @Query("code") String code
    );

    /**工行开户
     * openAccount
     */
    @POST("icbc/openAccount")
    Observable<BaseEntity<OpenAccountResult>> openAccount(
        @Body AccountTranModel accountTranModel
    );

    /**发送工行内部短信（工行卡验证）
     * openAccount
     */
    @POST("icbc/sendSms")
    Observable<BaseEntity> bindCard(
            @Body BindCardModel bindCardModel
    );



    /**
     * 开户信息验证
     请求地址：https://{HOST}/icbc/openAccountVerify
     */
    @POST("icbc/openAccountVerify")
    Observable<BaseEntity> openAccountVerify(
            @Body AccountVerify accountVerify
    );

    /**
     * 用户电子钱包查询
     请求地址：https://{HOST}/icbc/queryAccount
     */
    @GET("icbc/queryAccount")
    Observable<BaseEntity> queryAccount(

    );

    /**
     * 工行身份证OCR-正面（新用户）
     */


    /**
     * 预约接口
     */
    @POST("vehicle/subscribe")
    Observable<BaseEntity<CodeModel>> apply(
            @Body PlateNoModel plateNo
    );

    /**
     * 获取用户信息
     */
    @GET("security/getMemberInfo")
    Observable<BaseEntity<UserDetailVo>> getUserDetail(
    );


    /**
     * 工单列表
     */
    @GET("vehicle/getSubscribes")
    Observable<BaseListEntity<SubscribeOrderListModel>> getSubscribes(
            @Query("page") int page,
            @Query("size") int pageSize
    );

    /**
     * 车牌列表
     */
    @GET("vehicle/getMemberVehicles")
    Observable<BaseListEntity<CarModel>> getCars(
            @Query("page") int page,
            @Query("size") int pageSize,
            @Query("showAll") boolean showAll
    );

    /**
     * 根据车牌号，换取url
     */
    @GET("https://clientapi.unicloudcar.com/externalPlatform/getYuCheBaoSubscribeUrl")
    Observable<BaseEntity<UrlItemModel>> getYuCheBaoSubscribeUrl(
            @Query("vehicleId") String vehicleId
    );


    /**
     * 根据车牌号，换取url
     */
    @GET("https://clientapi.unicloudcar.com/vehicle/getEcertUrl")
    Observable<BaseEntity<UrlItemModel>> getNianJianUrl(
            @Query("vehicleId") String vehicleId
    );


    @GET("https://clientapi.unicloudcar.com/vehicle/getTmriVehicleLic")
    Observable<BaseEntity<UrlItemModel>> getXSZUrl(
            @Query("vehicleId") String vehicleId
    );


//    年检标
//    https://clientapi.unicloudcar.com/vehicle/getEcertUrl?vehicleId=0
//    电子行驶证
//    https://clientapi.unicloudcar.com/vehicle/getTmriVehicleLic?vehicleId=0



    /**
     * 是否可预约
     */
    @GET("vehicle/isSubscribedByPlateNo")
    Observable<BaseEntity<VehicleId>> isApply(
        @Query("plateNo") String plateNo
    );

    /**
     * 短信接口
     */
    @FormUrlEncoded
    @POST("security/sendValidCode")
    Observable<BaseEntity> getCode(
            @Field("cellphone") String cellphone
    );



    /**
     * 上传身份证正面ocr
     */
    @Multipart
    @POST("icbc/idcardFrontOcr")
    Observable<BaseEntity<IdcardFrontOcrModel>> idcardFrontOcr(@Part List<MultipartBody.Part> partList);

    /**
     * 上传身份证反面ocr
     */
    @Multipart
    @POST("icbc/idcardBackOcr")
    Observable<BaseEntity<IdcardBackOcrModel>> idcardBackOcr(@Part List<MultipartBody.Part> partList);
}
